let utils = data["utils"];
let STUtil = data["STUtil"];
let Node = data["Node"];
let SplayTree = data["SplayTree"];
let isInBbox = data["isInBbox"];
let getBboxOverlap = data["getBboxOverlap"];
let cmp = data["cmp"];
let rounder = data["rounder"];
let geomIn = data["geomIn"];
let geomOut = data["geomOut"];
let operation = data["operation"];
let Segment = data["Segment"];
let SweepEvent = data["SweepEvent"];
let SweepLine = data["SweepLine"];
let polygonClipping = data["polygonClipping"];
let DynamicLabel = data["DynamicLabel"];
console.log("16DynamicLabel05");

utils.extend(DynamicLabel.prototype, {
  getInteriorPointOfArray: function (flatCoordinates, offset, ends, stride, flatCenters, flatCentersOffset, opt_dest) {
    function numberSafeCompareFunction(a, b) {
      return a > b ? 1 : a < b ? -1 : 0
    }
    let i, ii, x, x1, x2, y1, y2;
    const y = flatCenters[flatCentersOffset + 1],
      intersections = [];
    for (let r = 0, rr = ends.length; r < rr; ++r) {
      const end = ends[r];
      for (x1 = flatCoordinates[end - stride], y1 = flatCoordinates[end - stride + 1], i = offset; i < end; i += stride) x2 = flatCoordinates[i], y2 = flatCoordinates[i + 1], (y <= y1 && y2 <= y || y1 <= y && y <= y2) && (x = (y - y1) / (y2 - y1) * (x2 - x1) + x1, intersections.push(x)), x1 = x2, y1 = y2
    }
    let pointX = null,
      maxSegmentLength = -1 / 0;
    for (intersections.sort(numberSafeCompareFunction), x1 = intersections[0], i = 1, ii = intersections.length; i < ii; ++i) {
      x2 = intersections[i];
      const segmentLength = Math.abs(x2 - x1);
      segmentLength > maxSegmentLength && (x = (x1 + x2) / 2, this.linearRingsContainsXY(flatCoordinates, offset, ends, stride, x, y) && (pointX = x, maxSegmentLength = segmentLength)), x1 = x2
    }
    return pointX == null && (pointX = flatCenters[flatCentersOffset]), opt_dest ? (opt_dest.push(pointX, y, maxSegmentLength), opt_dest) : [pointX, y, maxSegmentLength]
  },
  linearRingsContainsXY: function (flatCoordinates, offset, ends, stride, x, y) {
    if (0 === ends.length) return !1;
    if (!this.linearRingContainsXY(flatCoordinates, offset, ends[0], stride, x, y)) return !1;
    for (let i = 1, ii = ends.length; i < ii; ++i)
      if (this.linearRingContainsXY(flatCoordinates, ends[i - 1], ends[i], stride, x, y)) return !1;
    return !0
  },
  linearRingContainsXY: function (flatCoordinates, offset, end, stride, x, y) {
    let wn = 0,
      x1 = flatCoordinates[end - stride],
      y1 = flatCoordinates[end - stride + 1];
    for (; offset < end; offset += stride) {
      const x2 = flatCoordinates[offset],
        y2 = flatCoordinates[offset + 1];
      y1 <= y ? y2 > y && (x2 - x1) * (y - y1) - (x - x1) * (y2 - y1) > 0 && wn++ : y2 <= y && (x2 - x1) * (y - y1) - (x - x1) * (y2 - y1) < 0 && wn-- , x1 = x2, y1 = y2
    }
    return 0 !== wn
  }
});

return {
  data: [{
    name: "DynamicLabel_plugins",
    value: {
      "utils": utils,
      "STUtil": STUtil,
      "Node": Node,
      "SplayTree": SplayTree,
      "isInBbox": isInBbox,
      "getBboxOverlap": getBboxOverlap,
      "cmp": cmp,
      "rounder": rounder,
      "geomIn": geomIn,
      "geomOut": geomOut,
      "operation": operation,
      "Segment": Segment,
      "SweepEvent": SweepEvent,
      "SweepLine": SweepLine,
      "polygonClipping": polygonClipping,
      "DynamicLabel": DynamicLabel
    }
  }]
}